/**
 * 
 */
package com.wolfware.athsweb.persistancy.springhibernate;

import java.util.List;

import com.wolfware.athsweb.domain.Competition;
import com.wolfware.athsweb.persistancy.dao.CompetitionDAO;

/**
 * Implementation of <code>CompetitionDAO</code>
 * 
 * @see CompetitionDAO
 * @author Christian Strzadala
 */
public class SpringHibernateCompetitionDAOImpl extends AbstractSpringHibernateGenericDAOImpl<Long, Competition> implements CompetitionDAO {

	public SpringHibernateCompetitionDAOImpl(){
		super(Competition.class);
	}
	
	/**
	 * {@inheritDoc}
	 */
	public List<Competition> getAllCompetitions() {
		return findAll();
	}

	/**
	 * {@inheritDoc}
	 */
	public Competition getCompetitionById(Long id) {
		return read(id);
	}

	/**
	 * {@inheritDoc}
	 */
	public void saveCompetitionEntries(List<Competition> competitionList) {
        for (Competition competition : competitionList) {
            create(competition);
        }
	}

	/**
	 * {@inheritDoc}
	 */
	public void saveCompetitionEntry(Competition competition) {
		create(competition);
	}

	/**
	 * {@inheritDoc}
	 */
	public void deleteCompetitionEntry(Competition competition) {
		delete(competition);
		
	}

	/**
	 * {@inheritDoc}
	 */
	public void updateCompetitionEntry(Competition competition) {
		update(competition);
		
	}
}